# -*- coding: utf-8 -*-
# @Author: Zach-Pineappleman
# @E-mail: 354399824@qq.com
# @Date:   2025-03-13 21:19:19
# @File_name:app.py
# @Last Modified by:   Zach-Pineappleman
# @Last Modified time: 2025-03-13 21:23:36

# 系统主页面展示
# app.py
# import customtkinter as ctk
# from webcam_handler import WebcamHandler
# from behavior_visualizer import BehaviorVisualizer

# class BehaviorVisualizationApp(ctk.CTk):
#     def __init__(self):
#         super().__init__()
#         self.title("行为监测与可视化系统")
#         self.geometry("900x600")
#         self.setup_ui()
#         self.webcam_handler = WebcamHandler(self)
#         self.webcam_handler.start()

#     def setup_ui(self):
#         self.main_frame = ctk.CTkFrame(self)
#         self.main_frame.pack(fill="both", expand=True)
#         self.behavior_visualizer = BehaviorVisualizer(self.main_frame)

#     def update_camera_frame(self, img):
#         # 更新摄像头画面
#         pass

# if __name__ == "__main__":
#     app = BehaviorVisualizationApp()
#     app.mainloop()

# app.py
import customtkinter as ctk
from webcam_handler import WebcamHandler
from behavior_visualizer import BehaviorVisualizer
from audio_player import AudioPlayer
from voice_detector import VoiceDetector
from config import *
from utils import setup_logging

class BehaviorVisualizationApp(ctk.CTk):
    def __init__(self):
        super().__init__()
        self.title("行为监测与可视化系统")
        self.geometry("900x600")
        setup_logging(LOG_FILE)
        self.setup_ui()
        self.webcam_handler = WebcamHandler(self)
        self.audio_player = AudioPlayer()
        self.voice_detector = VoiceDetector(self)
        self.webcam_handler.start()
        self.voice_detector.start()

    def setup_ui(self):
        self.main_frame = ctk.CTkFrame(self)
        self.main_frame.pack(fill="both", expand=True)
        self.behavior_visualizer = BehaviorVisualizer(self.main_frame)

    def update_camera_frame(self, img):
        # 更新摄像头画面
        pass

    def handle_voice_input(self, audio_data):
        # 处理语音输入
        pass

if __name__ == "__main__":
    app = BehaviorVisualizationApp()
    app.mainloop()